<?php 
//Security Checking for the user if allowed to login.
session_start();
if(strlen($_SESSION['u_name'])==0)
{
	?>
	<script>
	window.open("admin-login.php","_self");
	</script>
	<?php 
	exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
.body {
	background-color:#a6bf79;
	color:#000000;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	margin: 10px 10px 10px 10px;
	padding: 0px;
}
.textLike
{
	color:#000000;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	padding: 0px;
}
</style>
<title>Admin -Edit Listings</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="../js/jquery-1.4.2.js" type="text/javascript" language="javascript"></script>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/menu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../formvalidation.js"></script>
</head>
<body class="body">
<div id="body" style="width:960px;min-height: 240px;height: auto;">
<div align="center">
<!-- Admin Home Page Menu Bar -->

<ul id="list-nav">
<li><a href="admin-homepage.php">Home</a></li>
<li><a href="admin-homepage.php">All Listings</a></li>
<!--<li><a href="approved-listing.php">Approved Listing</a></li>-->
<li><a href="unapproved-listing.php">Deactivated Listing</a></li>
<li><a href="new-listing.php">New Lists</a></li>
<li><a href="admin-themelist.php">Theme List</a></li>
<li><a href="secure.php?logout=yes">Log Out</a></li>
</ul>


<!-- Menu Bar Ends -->
</div>
<br />

<?php 
/*
 * Summary : Created By Avik on 18th April,2010
 * Version : 1.0
 * Contents: This file Shows All the data Admin Home page
 * Chnages
 */

#===========AUTHENTICATION========================#
session_start();
if(empty($_SESSION['u_name']))
{
	header("Location:admin-login.php");
}
//#########INCLUDE FILES########
include_once '../conf/db-config.php';
include_once '../conf/error.php';
include_once '../clsFetchData.php';
include_once '../array_to_xml.php';
//##############################

$objFetchData = new clsFetchData();
$arrDataToShow = array();
$categoryList = array();
unset($arrDataToShow);
$categoryList  = $objFetchData->FetchAllCategories();

$editId = $_REQUEST['id'];
$arrDataToShow = $objFetchData->getAllDataForId($editId);
$heading = "Edit Listings";
?>
<h3 style="padding-left: 50px;padding-bottom: 10px;"><u><i><?php echo $heading; ?></i></u></h3>

<!-- EDIT AREA STARTS -->
<form action="../listdatasave.php?action=editSave&id=<?php echo $arrDataToShow['sl_no']; ?>" enctype="multipart/form-data" method="post" name="ListYourBusiness" id="ListYourBusiness" onsubmit="return validate(this);">
          <table width="960" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF" style="padding: 15px 15px 15px 15px">
            
            <tr valign="top"> 
              <td width="250" height="80px;"> 
                <div align="left"><b>Please choose a Category from the drop down list:&nbsp;</b><br />
                  <span class="textsmall">Example: Attractions</span></div><br />

              </td>
              <td width="250"><div align="left"> 
                <select name="businessCategory[]" multiple="multiple" style="width: 200px;">
					<?php 
					
					foreach ($categoryList as $arrData)
					{
						$category = stripslashes($arrData['name']);
						if($category == $arrDataToShow['theme'])
						{
							$theme = "selected='selected'";
						}
						else
						{
							$theme = "";
						}
						?>
						<option value="<?php echo $category; ?>" <?php echo $theme; ?>><?php echo $category; ?></option>
						<?php 
					}
					?>
			   </select>
			   </div>
            </td>
            </tr>
            <tr valign="top"> 
              <td width="250"> 
                <div align="left"><b>Give your business listing a Title:</b><br />
                  <span class="textsmall">Example: Kelowna Dinner Cruises</span></div><br />

              </td>
              <td width="250"><div align="left"> 
                <input type="text" name="listingTitle" id="listingTitle" size="45" value="<?php echo $arrDataToShow['business_title'] ;?>">
              </div>
</td>
            </tr>
            <tr valign="top"> 
              <td width="250"> 
                <div align="left"><b>Describe your business in 50 words or less:&nbsp;</b><br />
                  </div><br />

              </td>
              <td width="250"><div align="left"> 
                <input type="text" name="businessDesc" size="45" value="<?php echo $arrDataToShow['business_desc'] ;?>" />
              </div>
</td>
            </tr>
            <tr valign="top"> 
              <td width="250"> 
                <div align="left"><b>A short Text Summary about your business:&nbsp;</b><br />
                  <span class="textsmall">Example: We do dinner cruises & public tours in Kelowna<br />
                  (72 Characters Maximum)</span></div><br />

              </td>
              <td><div align="left"> 
               
				<input name="shortSummary" type="text" maxlength="72" size="45" value="<?php echo $arrDataToShow['business_summary'] ;?>"><br>

</div>
</td>
            </tr>
            
            <tr valign="top"> 
              <td width="250"> 
                <div align="left"><b>Business Phone Number:</b><br />
                  <span class="textsmall">Example: 250-215-2779</span></div><br />

              </td>
              <td width="250"><div align="left"> 
                <input type="text" name="phone" id="phone" size="45" value="<?php echo $arrDataToShow['phone_number'] ;?>">
              </div>
</td>
            </tr>
            
            <!-- TOLL FREE AND FAX STARTS -->
            <tr valign="top"> 
              <td width="375"> 
                <div align="left"><b>Toll-free Number:&nbsp;</b><br /><br />
              </td>
              <td width="300"><div align="left"> 
                <input type="text" name="tollfree" id="tollfree" size="45" value="<?php echo $arrDataToShow['tollfree_number'] ;?>">
              </div>
</td>
            </tr>
            
            <tr valign="top"> 
              <td width="375"> 
                <div align="left"><b>Fax Number:&nbsp;</b><br /><br />
                                </td>
              <td width="300"><div align="left"> 
                <input type="text" name="fax" id="fax" size="45" value="<?php echo $arrDataToShow['fax_number'] ;?>">
              </div>
</td>
            </tr>
            <!-- TOLL FREE AND FAX ENDS -->
            
            <tr> 
              <td width="250"> 
                <div align="left"><b>Business Street Address:&nbsp;</b><br />
                  <span class="textsmall">Example: 100 Bernard Ave Kelowna BC V1Y9G3</span></div><br />

              </td>
              <td width="250" valign="top"><div align="left"> 
                <input type="text" name="streetAddress" size="45" value="<?php echo $arrDataToShow['street_address'] ;?>">
              </div>
</td>
            </tr>
            <tr valign="top"> 
              <td width="250"> 
                <div align="left"><b>What City is your business in?:&nbsp;</b><br />
                  <span class="textsmall">Example: Kelowna, BC</span></div><br />


              </td>
              <td width="250"><div align="left"> 
                <input type="text" name="city" id="city" size="45" value="<?php echo $arrDataToShow['city'] ;?>">
              </div><br />

</td>
            </tr>
            <tr valign="top"> 
              <td width="250"> 
                <div align="left"><b>State / Province :&nbsp;</b><br />
                  <span class="textsmall">Example: BC</span></div><br />


              </td>
              <td width="250"><div align="left"> 
                <input type="text" name="state" id="state" size="45" value="<?php echo $arrDataToShow['state'] ;?>" maxlength="8">
              </div><br />

</td>
            </tr>
            <!-- Zip C0de -->
            <tr valign="top"> 
              <td width="250"> 
                <div align="left"><b>Zip code :</div><br />
              </td>
              <td width="250"><div align="left"> 
                <input type="text" name="zipCode" id="zipCode" size="45" value="<?php echo $arrDataToShow['zipcode'] ;?>" >
              </div><br />
			</td>
            </tr>
            <!-- Zip Code Ends -->
            <tr> 
              <td> 
                <div align="left"><b>Business Email Address:&nbsp;</b><br />
                  <span class="textsmall">Example:  info@kelownadinnercruises.com</span></div><br />

              </td>
              <td width="250" valign="top"><div align="left"> 
                <input type="text" name="email" size="45" value="<?php echo $arrDataToShow['email_address'] ;?>">
              </div>
</td>
            </tr>
            
            <tr> 
              <td> 
                <div align="left"><b>Business Website Address:&nbsp;</b><br />
                  <span class="textsmall">Example: www.kelownadinnercruises.com</span></div><br />

              </td>
              <td width="250" valign="top"><div align="left"> 
                <input type="text" name="website" size="45" value="<?php echo $arrDataToShow['website_address'] ;?>">
              </div>
</td>
            </tr>
            
            <tr> 
              <td> 
                <div align="left"><b>Business Audio URL:&nbsp;</b><br />
</div><br />
<br />

              </td>
              <td width="250" valign="top"><div align="left"> 
                <input type="text" name="audioURL" size="45" value="<?php echo $arrDataToShow['audio_url'] ;?>">
              </div>
</td>
            </tr>
            
            <tr> 
              <td> 
                <div align="left"><b>Business Video URL (must be a MPEG 4 or YouTube):&nbsp;</b><br />
                  <span class="textsmall">Example: http://www.youtube.com/watch?v=NRaQTrmfAR8</span></div><br />

              </td>
              <td width="250" valign="top"><div align="left"> 
                <input type="text" name="videoURL" size="45" value="<?php echo $arrDataToShow['video_url'] ;?>">
              </div>
</td>
            </tr>
            
            <tr> 
              <td width="250" valign="top"> 
                <div align="left">
                  <b>Upload your Business Logo:&nbsp;</b><br /><br />

                </div>
              </td>
              <td width="250" valign="top">
              <div align="left"> 
                <input type="file" name="upload1" id="upload1" size="35" value="" />
                <input  type="hidden"  value="<?php echo $arrDataToShow['business_logo']; ?>" id="hdnImagePath"  name="hdnImagePath" />
              </div>
			<?php if(file_exists("../".$arrDataToShow['business_logo'])){
			 ?>
				&nbsp;<img alt="" src="<?php echo "../".$arrDataToShow['business_logo']; ?>" width="150" height="100" />
			<?php 
			}
			else
			{
				?>
				<span>No Images Found.</span>
				<?php 
			}
			?>
			</td>
            </tr>
            
            <tr> 
              <td width="300" valign="top"> 
                <div align="left"><b>Upload Up to 4 photos of your business:&nbsp;</b><br /><br />
			</div>
			</td>
              <td width="300" valign="top"><div align="left"> 
                <input id="upload2" class="uploadinput" type="file" name="upload2" size="35" value="" /><br /><br />
                <input  type="hidden"  value="<?php echo $arrDataToShow['image_1']; ?>" id="hdnImagePath2"  name="hdnImagePath2" />
			<?php if(file_exists("../".$arrDataToShow['image_1']) && (strlen($arrDataToShow['image_1'])>0)){
			 	//echo "../".$arrDataToShow['image_1'];
				?>
				&nbsp;<img alt="" src="<?php echo "../".$arrDataToShow['image_1']; ?>" width="150" height="100" />
				&nbsp;<a onclick="deleteImageFromServer('<?php echo "../".$arrDataToShow['image_1']; ?>');">Delete</a>
			<?php
			}
			else
			{
				?>
				<span>No Images Found.</span>
				<?php 
			}
			?>
				<br /><br />
                <input id="upload3" class="uploadinput" type="file" name="upload3" size="35" value="" />
                <input  type="hidden"  value="<?php echo $arrDataToShow['image_2']; ?>" id="hdnImagePath3"  name="hdnImagePath3" />
			<?php if(file_exists("../".$arrDataToShow['image_2']) && (strlen($arrDataToShow['image_2'])>0)){
			 ?>
				&nbsp;<img alt="" src="<?php echo "../".$arrDataToShow['image_2']; ?>" width="150" height="100" />
			<?php 
			}
			else
			{
				?>
				<span>No Images Found.</span>
				<?php 
			}
			?>
                <br /><br />
                <input id="upload4" class="uploadinput" type="file" name="upload4" size="35" value="" />
            <input  type="hidden"  value="<?php echo $arrDataToShow['image_3']; ?>" id="hdnImagePath4"  name="hdnImagePath4" />    
			<?php if(file_exists("../".$arrDataToShow['image_3']) && (strlen($arrDataToShow['image_3'])>0)){
			 ?>
				&nbsp;<img alt="" src="<?php echo "../".$arrDataToShow['image_3']; ?>" width="150" height="100" />
			<?php 
			}
			else
			{
				?>
				<span>No Images Found.</span>
				<?php 
			}
			?>
                <br /><br />	
                <input id="upload5" class="uploadinput" type="file" name="upload5" size="35" value="" />
                <input  type="hidden"  value="<?php echo $arrDataToShow['image_4']; ?>" id="hdnImagePath5"  name="hdnImagePath5" />    
			<?php if(file_exists("../".$arrDataToShow['image_4']) && (strlen($arrDataToShow['image_4'])>0)){
			 ?>
				&nbsp;<img alt="" src="<?php echo "../".$arrDataToShow['image_4']; ?>" width="150" height="100" />
			<?php 
			}
			else
			{
				?>
				<span>No Images Found.</span>
				<?php 
			}
			?>
			<br /><br />
			
			
			
                <b>You may upload GIF, JPG, JPEG, and PNG files.</b>
              </div>
</td>
           </tr>
           
           <!-- Bar Code Image Uploader -->
           
             <tr> 
              <td width="250" valign="top"> 
                <div align="left">
                  <b>Upload your Bar Code Image:&nbsp;</b><br /><br />

                </div>
              </td>
              <td width="250" valign="top">
              <div align="left"> 
                <input type="file" name="uploadBarCode" id="uploadBarCode" size="35" value="" />
                <input  type="hidden"  value="<?php echo $arrDataToShow['barcode_image']; ?>" id="hdnBarCodeImagePath"  name="hdnBarCodeImagePath" />
              </div>
			<?php if(file_exists("../".$arrDataToShow['barcode_image'])){
			 ?>
				&nbsp;<img alt="" src="<?php echo "../".$arrDataToShow['barcode_image']; ?>" width="150" height="100" />
			<?php 
			}
			else
			{
				?>
				<span>No Bar-code Image Found.</span>
				<?php 
			}
			?>
			</td>
            </tr>
           
           <!-- Bar Code Image Upload Ends -->
           
            <tr valign="top"> 
              <td width="250"> 
                <div align="left" style="height:25px">
                  <!--NULL SPACER DIV-->
                </div>
              </td>
              <td width="250">
                <div align="left" style="height:25px"> 
                  <!--NULL SPACER DIV-->
                </div>
				</td>
            </tr>               
            <tr valign="top"> 
              <td width="250"> 
                <div align="left"><b>Name of GlobalToDo Sales Rep:</b></div><br />
              </td>
              <td width="250"><div align="left"> 
                <input type="text" name="salesRep" size="45" value="">
              </div>
</td>
            </tr>            
            
            <tr> 
              <td colspan="2"> 
                <div align="center"> 
                  <INPUT class="normalBtn" TYPE="submit" VALUE="Submit >>" />
                  <INPUT class="normalBtn"  TYPE="reset" VALUE="Clear >>" />
                </div>
              </td>
            </tr>
            </table>
                          
              
        </form>


<!-- EDIT AREA ENDS -->
</div>

<script type="text/javascript">
</script>

</body>
</html>